package com.接口;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2023/2/17 16:04
 * @description:
 * @version:
 */
public class PredicateTest {
    public static void main(String[] args) {
        testPredicate();
    }

    public static void testPredicate() {
        Predicate<Integer> predicate = new Predicate() {
            @Override
            public boolean test(Object o) {
                return false;
            }
        };
        System.out.println(predicate.test(10));


        predicate = (s) -> s > 5;
        System.out.println(predicate.test(10));


        List<Integer> aList = Arrays.asList(13, 3, 5);
        aList = aList.stream().filter(predicate).collect(Collectors.toList());
        System.out.println(aList);
    }
}
